@extends('user.layouts.head')
@section('content')
    @inject('cookie', 'Illuminate\Support\Facades\Cookie')
    <style>
        table {
            border-collapse: collapse;
            width: 100%;
            margin: auto;
            margin-top: 20px;
        }
    th, td {
            border: 3px solid #f4cf00;
            text-align: center;
            padding: 10px;
    }
        .qiang-btn, .qiang-btn-dis, list-inline {
            display: inline-block;
            padding: 0 15px;
            background-color: red;
            color: #fff;
            height: 30px;
            line-height: 30px;
            text-align: center;
            border-radius: 3px;
        }
        .qiang-btn-dis {
            background-color: #c8cbcf;
        }
        .web-tool {
            margin-top: 10px;
            float: left;
        }
        .web-tool a {
            float: left;
            margin-left: 10px;
            color: #f3ef0a;
        }
        .textbox p {
            font-size: 16px;
        }
        .banner-ad-con {
            margin: 0 auto;
            /*width: 1380px;*/
            width: 85%;
            display: flex;
            justify-content: space-between;
            height: 450px;
            align-items: center;
            /*width: 1440px;
            margin: 0 auto 50px;
            padding-top: 40px;*/
        }
        .banner-ad {
            /*width: 100%;*/
            /*display: flex;*/
            /*justify-content: space-between;*/
        }
        .banner-logo {
            width:352px;
            height:194px;
            /*background: url("../images/bgi-logo.png") no-repeat top center;*/
            z-index:1000;
        }
        .text-top {
            width:794px;
            height:205px;
            background: url("../images/text-top.png") no-repeat top center;
            z-index:1000;
        }
        .text-bottom {
            width:957px;
            height:277px;
            /*background: url("../images/text-bottom.png") no-repeat top center;*/
            z-index:1000;
        }
        .banner-bottom {
            /*margin-top: 40px;*/
            /*width: 100%;*/
            /*display: flex;*/
            /*justify-content: space-between;*/
        }
        .login-mobile-btn {
            text-align: center;
            width: 40%;
            margin: 10px auto;
            height: 35px;
            line-height: 35px;
            cursor: pointer;
            border-radius: 4px;
            background-color: #9e1515;
            color: #eee;
        }
        .rightbar2 {
            width: 210px;
            height: 0px;
            position: fixed;
            right: 0px;
            bottom: -40px;
            background: url(https://www.2024wf.com/images/hezi.png) no-repeat left top;
            padding: 200px 10px 0px 0px;
            z-index: 132;
            text-align: center;

            color: #000;
            -o-transition: all .5s;
            -webkit-transition: all .5s;
            -moz-transition: all .5s;
            -ms-transition: all .5s;
            transition: all .5s;
        }
        .rightbar2 .downlist {
            float: left;
            margin-top: -90px;
            margin-left: 4px;
            padding-left: 15px;
        }
        .rightbar2 .downlist li a {
            float: left;
            width: 200px;
            height: 120px;
            position: relative;
            text-indent: -9999em;
            display: block;
            margin-left: 0px;
            margin-top: -60px;
            background-size: 100%;
            padding-left: 5px;
        }

        .left-bar {
            width: 230px;
            height: 500px;
            position: fixed;
            right: 0;
            top: 450px;
            background: url(https://l3y.oss-cn-beijing.aliyuncs.com/left_bar%281%29.png) no-repeat left top;
            z-index: 132;
            text-align: center;

            color: #000;
            -o-transition: all .5s;
            -webkit-transition: all .5s;
            -moz-transition: all .5s;
            -ms-transition: all .5s;
            transition: all .5s;
        }

        .login-box-bg {
            width: 400px;
            height: 450px;
            background-color: rgba(0,0,0,.6);
            transform: skewX(-8deg);
        }

        .login-box {
            transform: skewX(8deg);
            margin: 0 auto;
            width: 320px;
            height: 290px;
            /* background: url('https://x5q.oss-cn-beijing.aliyuncs.com/static/images/login-bg.png') no-repeat; */
            background-size: cover;
            /* background-color: #FFFFFF; */
            border-radius: 5px;
            text-align: center;
            box-sizing: border-box;
            /*background: #FFFFFF;*/
            /* position: relative; */
        }

        .login-box .no-login {
            margin-top: 66px;
            position: relative;
            /*display: none;*/
        }
        .login-box .login{
            /* display: none; */
        }
        .login-box .logo-info {
            display: flex;
            justify-content: center;
        }

        .login-box .no-login {

        }

        .login-box .no-login .logo-info {
            display: flex;
            margin-top: -10px;
            margin-bottom: 10px;
        }

        .login-box .no-login .logo-info .logo {
            width: 140px;
            height: 140px;
            padding: 4px;
        }

        .login-box .no-login .logo-info .logo-info-col {
            display: flex;
            flex-direction: column;
            justify-content: center;
            margin: 0 18px;
            text-align: center;
        }

        .login-box .no-login .logo-info .logo-info-col h3 {
            font-weight: bold;
            line-height: 28px;
            margin: 20px 0 0;
        }

        .login-box .no-login .logo-info .logo-info-col h4 {
            margin-top: 0px;
            margin-bottom: 0px;

        }

        .login-box .no-login .title {
            text-align: center;
            font-size: 15px;
            margin: 10px 0;
            line-height: 20px;
        }

        .login-box .no-login .tip {
            color: #888888;
            text-align: center;
            font-size: 13px;
        }
        .login-sm-btn {
            padding: 14px 16px;
            background-color: #9e1515;
            color: #fff;
            cursor: pointer;
            width: 200px;
            margin: 0 auto;
            font-size: 14px;
            border-radius: 4px;
        }
    </style>
    <style>
    .container {
        max-width: 1380px;
        margin: 0 auto;
        padding: 10px;
        display: flex;
        flex-wrap: wrap;
        /*justify-content: space-between;*/
    }

    .game {
        flex-basis: calc(20% - 10px);
        margin-bottom: 20px;
        width: 20%;
    }
    .game .inner {
      display: flex;
      flex-direction: column;
      flex: 1;
      padding: 10px;
    }
    .game img {
        width: 100%;
        height: 125px;
        object-fit: cover;
    }

    .game-info {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: flex-start;
    }

    .game-name,
    .game-time,
    .game-type {
        margin: 5px 0;
    }

    .buttons {
        display: flex;
        justify-content: center;
    }

    .button {
        padding: 10px 20px;
        margin: 5px;
        border: none;
        cursor: pointer;
    }

    .gift {
        background-color: #afa423e6;
        color: white;
    }

    .enter {
        background-color: #bd1c5f;
        color: white;
    }

    /* Responsive adjustments */
    @media (max-width: 1200px) {
        .game {
            flex-basis: calc(25% - 10px);
        }
    }

    @media (max-width: 900px) {
        .game {
            flex-basis: calc(33.3333% - 10px);
        }
    }

    @media (max-width: 600px) {
        .game {
            flex-basis: calc(50% - 10px);
        }
    }

    @media (max-width: 480px) {
        .game {
            flex-basis: 100%;
        }
    }
</style>

    <body style="height: 100%">
    <!-------顶部-------->

    <!-------顶部end-------->
    <div id="app" class="tw-nav">
        <div class="mains" style="width: 1680px;margin: 0 auto;">
            <div class="nav-logo">
                <a href="#" title=""
                    style="background:url(https://x5q-1302642180.cos.ap-beijing.myqcloud.com/591wf/logo.jpg) center no-repeat;width: 350px;">
                </a>
            </div>
            <div id="nav-box" class="nav nav-box menu">
                <ul class="layui-nav" lay-filter="">
                    <li class="" :class="{ 'layui-this': activeIndex === '1' }"><a href="https://www.2024wf.com">首页</a></li>
                    <li class="go-recharge-btn" :class="{ 'layui-this': activeIndex === '2' }"><a href="javascript:;">个人中心</a></li>
                    <li class="" :class="{ 'layui-this': activeIndex === '3' }"><a href="/friend.html">邀请好友</a></li>
                    <li class="" :class="{ 'layui-this': activeIndex === '4' }"><a href="/tutorial.html">新人教程</a></li>
                    <li class="" :class="{ 'layui-this': activeIndex === '5' }"><a href="/jifen.html">玩服积分介绍</a></li>
                    <li class="" :class="{ 'layui-this': activeIndex === '6' }"><a href="http://check.x5q.vip:8899" target="_blank">爆率查询</a></li>
                    <li class="" :class="{ 'layui-this': activeIndex === '7' }"><a href="/bfk.html">包服卡</a></li>
                    <li class="go-yjjy-btn" :class="{ 'layui-this': activeIndex === '8' }"><a href="javascript:;">投诉建议</a></li>
                </ul>
            </div>
        </div>
</div>

    <!-------页面主体-------->
    <div class="wrap g-wrap" style="position: relative;background-image:url('https://x5q-1302642180.cos.ap-beijing.myqcloud.com/365wf/index-bg.jpg'); background-size: 100%;">
      
        <div style="background-size: 100% 450px; background-repeat: no-repeat; width: 100%;height: 450px; position: absolute; top:0;left: 0;">
            <video data-v-5aa4aa3b="" autoplay="autoplay" loop="loop" muted="muted">
                <source data-v-5aa4aa3b="" src="https://l3y.oss-cn-beijing.aliyuncs.com/banner.mp4">
            </video>
        </div>
       
        <div class="banner-ad-con">
            <div class="login-box-bg">
                <div class="login-box">
                    <div class="no-login">
                        <h3 style="color: #f8f7f6;margin-bottom: 40px;font-size: 20px;">会员中心登录</h3>

                        <div class="logo-info">
                            @if(!$is_login)
                                <div class="logo" style="background-color:#fff;">
                                    <div id="index-qrcode"></div>
                                </div>
                            @else
                                <img class="logo" src="/images/df-head.png"
                                     alt="">
                            @endif


                        </div>
                        <!--<div class="title">{{$is_login ? $user_info->username : '登录会员享网站充值优惠'}}</div>-->
                        @if($is_login)
                            <!--<div class="tip">ID: {{$user_info->wx_unionid}}</div>-->
                        @endif

                        <div class="btn-box" style="text-align:center;margin-top: 30px;">
                            @if(!$is_login)
                                <!--<div type="button" class="login-sm-btn" id="WeChatLogin">微信扫码登录</div>-->
                                <button type="button" class="layui-btn layui-btn-danger layui-btn-radius" id="WeChatLogin" style="padding-left: 20px; padding-right: 20px;">微信扫码登录</button>
                            @else
                                <div type="button" class="login-sm-btn" id="outLogin">退出登录</div>
                            @endif
                        </div>

                    </div>
                </div>
            </div>

            <div class="banner-bottom">
                <div id="zhuanpan">
                    <div class="rotate-con-pan">
                        <div class="rotate-con-zhen"></div>
                    </div>
                </div>
            </div>

        </div>
    {{--    <div class="erweima1"><img src="images/qqqun.png" alt="扫码加入Q群" width="120" height="120"></div>--}}

    
        <!-------banner end-------->

        <!-------中间部分-------->
        <div class="main content">
            <table >
                    <tr>
                        <th colspan="2">攻沙版本:刀剑江湖</th>
                    </tr>
                    <tr>
                        <td>27号开启26号区攻沙</td>
                        <td>奖励500</td>
                    </tr>
                    <tr>
                        <td>28号开启27号区攻沙</td>
                        <td>奖励500</td>
                    </tr>
                     <tr>
                        <td>29号开启28号区攻沙</td>
                        <td>奖励500</td>
                    </tr>
                    <tr>
                        <td>30号统战区攻沙</td>
                        <td>奖励1000</td>
                    </tr>
            </table>
            
            
            <!-------&推荐-------->
            <div class="mod mb35" id="st-gift-list" >
                <div class="kf-news-tit">
                    <span class="kf-news-h3 fl">今日强档开区推荐</span>
                </div>
                <ul class="fix" style="display: flex;flex-wrap: nowrap;justify-content: center;">

                    @foreach($today['tj_games'] as $data)
                        <li class="hbgame" >
                            <div class="c-wt-img fl">
                               
                                <em class="c-wt-dudai"></em>
                                <i><img src="https://info.l3y.vip/uploads/{{$data->image}}" alt="{{$data->server_name}}" width="290" height="280" /></i>
                                <div class="zhez">
                                    <a href="{{$data->login_down}}" class="zhez-ksyx">登录器下载</a>
                                    <span><a href="{{$data->url}}" target="_blank" title="官网网站">进入官网</a>|<a href="{{$data->kf_url}}" target="_blank" title="在线客服">在线客服</a></span>
                                </div>
                            </div>
                            <div class="c-wt-txt fl">
                                <div class="c-wt-top">
                                    <a href="{{$data->url}}" target="_blank" class="c-wt-a">
                                        <em>{{$data->server_name}}</em>
                                        <i></i>
                                    </a>
                                </div>
                                <p class="c-wt-xfq">开服时间：{!! getOpenServerTime($data) !!}</p>
                                <p class="c-wt-xfq">游戏类型：{{$data->server_ip}}</p>
                                
                                <button type="button" class="layui-btn layui-btn-danger layui-btn-lg yx-ks" data-ks='{{$data->url}}' style="margin-left:50px;margin-top:10px;">开始游戏</button>
                            </div>
                        </li>
                    @endforeach

                </ul>



            </div>
            <!-------&推荐end-------->

            <div style="padding-bottom: 120px;">

                <div class="other-game mt35" id="today-gift-list" style="padding-top: 10px; margin-bottom: 10px;">
                     <div style="height:40px;width:100%;position:relative;margin-bottom:10px;">
                        <span class="fl" style="height:30px;border-left:3px solid #FDE701;font-size:22px;color:#333;line-height:30px;display:block;margin-top:5px;text-indent:10px;font-weight:border;">首沙和次沙奖励18800/8800玩服积分版本</span>
                    </div>
                    <div class="other-game-box">
                        
                        <table class="tab1" width="1380px" border="0" cellpadding="0" cellspacing="0" >
                            <tr>
                                <td class="bg_1">游戏类型</td>
                                <td class="bg_2">版本类型</td>
                                <td class="bg_3">开区时间</td>
{{--                                <td class="bg_4">余额兑换 </td>--}}
                                <td class="bg_5">游戏简介</td>
                                <td class="bg_6">福利</td>
                                {{--                        <td class="bg_7">领取记录</td>--}}
                                <td class="bg_8">游戏入口</td>
                            </tr>

                            @foreach($today['top_games'] as $data)
                                <tr>
                                    <td class="bg_11"><span>【首沙】{{$data->server_name}}</span></td>
                                    <td class="bg_22"><span>{{$data->tagNames}}</span></td>
                                    <td class="bg_33">
                                            <span>
                                                {!! getOpenServerTime($data) !!}
                                            </span>
                                    </td>
{{--                                    <td class="bg_44">--}}
{{--                                        <!--<button type="button" class="layui-btn layui-btn-warm layui-btn-radius go-dh-btn" data-id="{{$data->id}}" style="padding-left: 16px; padding-right: 16px;"> 余额兑换 </button>-->--}}
{{--                                        ---}}
{{--                                    </td>--}}
                                    <td class="bg_55"><span>{{$data->introduction}}</span></td>
                                    <td class="bg_66">
                            <span>
                                {{$data->money}}&nbsp;&nbsp;
                                @if($data->count)
                                    数量：{{$data->get_num}}/{{$data->count}}
                                    @if($data->count > $data->get_num)
                                        <a href="javascript:void(0);" class="qiang-btn" onclick="getOpenDate({{$data->id}},'{{$data->server_name}}','{{$data->money}}', {{$data->count}}, {{$data->get_num}})"> 开抢 </a>
                                    @else
                                        <a href="javascript:void(0);" class="qiang-btn-dis"> 已抢完 </a>
                                    @endif
                                @endif
                            </span>
                                    </td>
                                    {{--                                    <td class="bg_77">--}}
                                    {{--                                        <a href="{{ route('userLog', '') . '/' . $data->id }}" class="qiang-btn" target="_blank"> 领取记录 </a>--}}
                                    {{--                                    </td>--}}
                                    <td class="bg_88">
                                        <!--<a class="starbtn2" href="{{$data->url}}" target="_blank" >进入游戏</a>-->
                                         <button type="button" class="layui-btn layui-btn-danger layui-btn-radius yx-btn" data-ulr="{{$data->url}}" style="padding-left: 15px; padding-right: 15px;">进入游戏</button>
                                    </td>
                                </tr>
                            @endforeach
                            @foreach($today['sub_games'] as $data)
                                <tr>
                                    <td class="bg_11"><span>【次沙】{{$data->server_name}}</span></td>
                                    <td class="bg_22"><span>{{$data->tagNames}}</span></td>
                                    <td class="bg_33">
                                            <span>
                                                {!! getOpenServerTime($data) !!}
                                            </span>
                                    </td>
{{--                                    <td class="bg_44">--}}
{{--                                    <!--<button type="button" class="layui-btn layui-btn-warm layui-btn-radius go-dh-btn" data-id="{{$data->id}}" style="padding-left: 16px; padding-right: 16px;"> 余额兑换 </button>-->--}}
{{--                                        ---}}
{{--                                    </td>--}}
                                    <td class="bg_55"><span>{{$data->introduction}}</span></td>
                                    <td class="bg_66">
                            <span>
                                {{$data->money}}&nbsp;&nbsp;
                                @if($data->count)
                                    数量：{{$data->get_num}}/{{$data->count}}
                                    @if($data->count > $data->get_num)
                                        <a href="javascript:void(0);" class="qiang-btn" onclick="getOpenDate({{$data->id}},'{{$data->server_name}}','{{$data->money}}', {{$data->count}}, {{$data->get_num}})"> 开抢 </a>
                                    @else
                                        <a href="javascript:void(0);" class="qiang-btn-dis"> 已抢完 </a>
                                    @endif
                                @endif
                            </span>
                                    </td>
                                    {{--                                    <td class="bg_77">--}}
                                    {{--                                        <a href="{{ route('userLog', '') . '/' . $data->id }}" class="qiang-btn" target="_blank"> 领取记录 </a>--}}
                                    {{--                                    </td>--}}
                                    <td class="bg_88">
                                        <!--<a class="starbtn2" href="{{$data->url}}" target="_blank" >进入游戏</a>-->
                                        <button type="button" class="layui-btn layui-btn-danger layui-btn-radius yx-btn" data-ulr="{{$data->url}}" style="padding-left: 15px; padding-right: 15px;">进入游戏</button>
                                        </td>
                                   
                                </tr>
                            @endforeach

                        </table>

                    </div>
                    <div style="clear:both;"></div>
                </div>

            <div class="search-bar" style="display: flex; align-items: center;">
                <div class="search-title" style="font-size: 22px;" id="game-search">快捷找游戏</div>

                <div class="layui-inline">
                    <div class="layui-input-inline" style="width: 300px; display: flex;align-items: center;margin-left: 100px;">
                        <input type="text" id="game-key" placeholder="请输入关键字" autocomplete="off" class="layui-input" value="{{$_GET['game_key']??''}}">
                        <button id="search-game" type="button" class="layui-btn layui-btn-primary"><i class="layui-icon layui-icon-search"></i></button>
                    </div>
                </div>
            </div>

           
            <!-------其他版本，单个可复制无限拓展-------->
            <div style="padding-bottom: 120px;">
                <div class="other-game mt35" id="today-gift-list" style="padding-top: 40px;">
                    <!--<div class="kf-news-tit">
                        <span class="kf-news-h3 fl">今日开服列表推荐</span>
                    </div>-->
                    <div class="other-game-box">

                        <table class="tab1" width="1380px" border="0" cellpadding="0" cellspacing="0" >
                            <tr>
                                <td class="bg_1">游戏类型</td>
                                <td class="bg_2">版本类型</td>
                                <td class="bg_3">开区时间</td>
                               
                                <td class="bg_5">游戏简介</td>
                                <td class="bg_6">福利</td>
                                {{--                        <td class="bg_7">领取记录</td>--}}
                                 <td class="bg_4">余额兑换 </td>
                                <td class="bg_8">游戏入口</td>
                            </tr>

                            @foreach($today['unpublished'] as $data)
                                @if($data->is_top == 0)
                                    <tr>
                                        <td class="bg_11"><span>{{$data->server_name}}</span></td>
                                        <td class="bg_22"><span>{{$data->tagNames}}</span></td>
                                        <td class="bg_33">
                                            <span>
                                                {!! getOpenServerTime($data) !!}
                                            </span>
                                        </td>
                                       
                                        <td class="bg_55"><span>{{$data->introduction}}</span></td>
                                        <td class="bg_66">
                            <span>
                                {{$data->money}}&nbsp;&nbsp;
                                @if($data->count)
                                    数量：{{$data->get_num}}/{{$data->count}}
                                    @if($data->count > $data->get_num)
                                        <a href="javascript:void(0);" class="qiang-btn" onclick="getOpenDate({{$data->id}},'{{$data->server_name}}','{{$data->money}}', {{$data->count}}, {{$data->get_num}})"> 开抢 </a>
                                    @else
                                        <a href="javascript:void(0);" class="qiang-btn-dis"> 已抢完 </a>
                                    @endif
                                @endif
                            </span>
                                        </td>
                                        {{--                                    <td class="bg_77">--}}
                                        {{--                                        <a href="{{ route('userLog', '') . '/' . $data->id }}" class="qiang-btn" target="_blank"> 领取记录 </a>--}}
                                        {{--                                    </td>--}}
                                         <td class="bg_44">
                                            <button type="button" class="layui-btn layui-btn-warm layui-btn-radius go-dh-btn" data-id="{{$data->id}}" style="padding-left: 15px; padding-right: 15px;"> 兑换 </button>
                                        </td>
                                        <td class="bg_88">
                                            <button type="button" class="layui-btn layui-btn-danger layui-btn-radius yx-btn" data-ulr="{{$data->url}}" style="padding-left: 15px; padding-right: 15px;">进入游戏</button>
                                        </td>
                                    </tr>
                                @endif
                            @endforeach

                        </table>



                    </div>
                    <div style="clear:both;"></div>
                </div>
            </div>

            <!--</div>-->
            <div style="clear: both;"></div>

        </div>
        <div class="footer">
            <div class="main">

                <div class="coinfo" style="display: flex;">
                    <a href="#" title="XX游戏" class="coinfo-logo fl"><img src="images/bomlogo.jpg" style="margin-top: -19px;"></a>
                    <div class="info">
                        <p class="info-bt">
                            <a href="#" target="_blank">关于我们</a>
                            <i>|</i>
                            <a href="#" target="_blank">防沉迷系统</a>
                            <i>|</i>
                            <a href="#" target="_blank">游戏纠纷处理</a>
                            <i>|</i>
                            <a href="#" target="_blank">用户协议</a>
                            <i>|</i>
                            <a href="#" target="_blank">家长监护</a>
                            <i>|</i>
                            <a href="#" target="_blank">技术安全保障措施</a>
                           <i>|</i>
                    <a> 游戏名称：百战沙场 审批文号：新广出审[2017]6460号 SBN号：ISBN 978-7-7979-9621-1</a>
                        </p>
                    </div>
                    <div class="legal-list fl">
                        {{--                <a href="#" target="_blank" class="legal-1">互联网文化</br>经营单位</a>--}}
                        {{--                <a href="#" target="_blank" class="legal-2">工商</br>行政管理局</a>--}}
                        {{--                <a href="#" target="_blank" class="legal-3">互联网</br>公安</a>--}}
                    </div>
                </div>
            </div>
        </div>
        <div style="clear: both;"></div>
       

    </div>
       
        <!-- <div class="left-bar"></div> -->
        <div class="rightbar2">

            <ul class="downlist">
                <li><a href="https://wwnw.lanzouh.com/iqFuF1h5br9g" target="_blank"></a></li>
            </ul>
        </div>

        

        <script src="{{ asset('/js/jquery.qrcode.min.js') }}"></script>
        <script src="{{ asset('/js/main.js') }}"></script>
        <script type="text/javascript" src="{{ asset('js/jquery.SuperSlide.2.1.1.js') }}"></script>
        <script type="text/javascript" src="{{ asset('js/public.js') }}"></script>
   
        <script type="text/javascript">
            $(function () {


                // jQuery('.slideBox').slide({mainCell:'.bd ul',effect:'fold',autoPlay:true,pnLoop:false});
                $('.kf-nav li').hover(function(){
                    var _index = $(this).index();
                    $(this).addClass('cur').siblings().removeClass('cur');
                    $(".kf-list-txt").hide().eq(_index).show();
                }).eq(0).trigger('hover');
                $('.news-nav li').hover(function(){
                    var _index = $(this).index();
                    $(this).addClass('cur').siblings().removeClass('cur');
                    $('.news-list-txt').hide().eq(_index).show();
                }).eq(0).trigger('hover');
                // jQuery('.picScroll-left').slide({titCell:'.hd ul',mainCell:'.bd ul',autoPage:true,effect:'leftLoop',vis:6,trigger:'click'});
            });

        </script>


        <script type="text/javascript">
            var dom = document.querySelector(".number")
            var digit = new Digit({
                number : 1888888.88, // 到达指定数值停止滚动
                finish : 5, // 整体完成时间
                speed : 1, // 数值越大，越多数字同时进行翻滚，取值范围（1 ~ 10）
                direction : "right", // 动画方向
                dom : dom, // 在指定dom节点插入动画
            })

            digit.render() // 执行
        </script>

        <script type="text/javascript">

            $(function(){

                $(".rotate-con-zhen").rotate({
                    bind:{
                        click:function(){
                            // alert('系统维护.请半小时后在操作');
                            // return
                            let _this = this;
                            // 获取今日抽奖情况
                            sendRequest('GET', '{{route("todayDraw", '')}}', {}, function (res) {
                                if (res.data === false) {
                                    // 接口获取服务器
                                    sendRequest('POST', '{{route("draws", '')}}', {}, function (res) {
                                        $(_this).rotate({
                                            duration:3000,               //转动时间
                                            angle: 0,                    //起始角度
                                            animateTo:1440+res.data.anger,      //结束的角度
                                            easing: $.easing.easeOutSine,//动画效果，需加载jquery.easing.min.js
                                            callback: function(){
                                                openCommitDrawPage(res.data.id)
                                                /*layer.open({
                                                    content: res.message,
                                                    yes: function(index, layero){
                                                        //do something
                                                        layer.close(index); //如果设定了yes回调，需进行手工关闭
                                                        // 打开提交账号页面
                                                        if (res.data.is_luck === 1) {
                                                            openCommitDrawPage(res.data.id)
                                                        }
                                                    }
                                                });*/
                                            }
                                        });
                                    })
                                    return;
                                } else if (res.data.is_luck === 1 && res.data.game_num === '') {
                                    openCommitDrawPage(res.data.id)
                                } else if (res.data.is_luck === 1 && res.data.status === 3) {
                                    // 异常了
                                    layer.alert(`您提交中奖信息异常，异常原因：【${res.data.msg}】, 请重新提交信息`, {
                                        closeBtn: 0
                                    }, function(){
                                        openCommitDrawPage(res.data.id)
                                    });
                                } else if (res.data.is_luck === 1 && res.data.status === 2) {
                                    layer.alert(`您的中奖信息正在处理中，请耐心等待`, {
                                        closeBtn: 0
                                    });
                                } else if (res.data.is_luck === 1 && res.data.status === 1) {
                                    layer.alert(`您的中奖信息已处理完成，请注意查收`, {
                                        closeBtn: 0
                                    });
                                } else {
                                    layer.msg('大侠今日与大奖擦肩而过，请明日再来');
                                }

                            })

                        }
                    }
                });

            });
            // 点击转盘可查询领奖到账情况
            function openCommitDrawPage(id) {
                layer.open({
                    type: 2,
                    title: "领取信息",
                    content: "{{route('getCommitDrawPage', '')}}/"+id,
                    scrollbar: false,
                    area: ['700px', '600px'],
                    cancel: function(index, layero){
                        if(confirm('你没有填写账号和游戏，无法领取奖励，确定关闭吗')){ //只有当点击confirm框的确定时，该层才会关闭
                            layer.close(index)
                        }
                        return false;
                    }
                })
            }

        </script>

        <script>


            function getOpenDate(id, game, money, total, current) {
                sendRequest('GET', '{{route("getGameServer", '')}}/' + id, {}, function (res) {
                    open_commit_box(id, game, money, total, current, res.data)
                })
            }

            function open_commit_box(id, game, money, total, current, serverList) {
                checkLogin();
                let titleHtml = `
<div class="game-money">
   ${money}
</div>
<div class="game-name">
   ${game}
</div>
<div class="get-num">
   数量：${current}/${total}
</div>
            `

                let formHtml = `
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="row">
                        <div class="col-lg-12" style="text-align: center;">
                            ` + titleHtml + `
                        </div>
                        <form class="layui-form" action="">
                            <input type="hidden" name="game_id" value="${id}">
                            <div class="layui-form-item">
                                <label class="layui-form-label">游戏账号:</label>
                                <div class="layui-input-block">
                                    <input type="text" name="game_num" required  lay-verify="required" placeholder="请输入游戏账号" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">确认账号:</label>
                                <div class="layui-input-block">
                                    <input type="text" name="game_num_re" required  lay-verify="required" placeholder="请确认游戏账号" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">游戏名称:</label>
                                <div class="layui-input-block">
                                    <select name="server_id" lay-verify="required" id="server-val"></select>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label">验证码:</label>
                                    <div class="layui-input-inline" style="width: 100px;">
                                        <input type="text" name="captcha" autocomplete="off" class="layui-input" id="captcha">
                                    </div>
                                </div>
                                <img src="{{captcha_src()}}" id="captcha_img" onclick="this.src='{{captcha_src()}}'+Math.random()">
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                  <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            `
                layer.open({
                    type: 1,
                    content: formHtml,
                    area: ['500px', '600px'],
                    title: '提交账号'
                })
                $.each(serverList, function (index, object) {
                    let dis = object.is_disable ? '' : 'disabled';
                    let checked = object.is_checked ? ' selected="selected""' : '';
                    console.log(object.server_name, checked)
                    $('#server-val').append(`<option value="${object.id}" ${dis} ${checked}>${object.server_name}(${object.open_server_time.substr(0,5)})</option>`);
                });
                layui.use('form', function(){
                    let form = layui.form;//高版本建议把括号去掉，有的低版本，需要加()
                    form.render('select');
                });

            }

            layui.use('form', function(){
                let form = layui.form;//高版本建议把括号去掉，有的低版本，需要加()
                form.on('submit(formDemo)', function(data){
                    console.log(data.field);
                    sendRequest('POST', '{{route("commitForm", "")}}',data.field, function (response) {
                        if (response.success === 'true') {
                            successMsg("领取成功");
                            setTimeout(function () {
                                window.location.reload()
                            }, 2000)
                        } else {
                            errorMsg(response.message, function () {
                                $('#captcha_img').attr('src', '/captcha/default?' + '?' + Math.random());
                            });
                        }
                    })
                    return false;
                });
            });


            // 登录页面
            function openLoginWin() {
                layer.open({
                    type: 2,
                    title: "登录",
                    content: "{{route('loginPage', '')}}",
                    scrollbar: false,
                    area: ['500px', '350px'],
                    cancel: function(index, layero){
                        layer.close(index)
                        return false;
                    }
                })
            }

            // 二维码切换验证码登录
            function goMobileLogin() {
                clearInterval(timeController);
                layer.closeAll();
                openLoginWin()
            }

           

            $(function () {
                // 首页登录二维码
                @if(!$is_login)
                getIndexLoginCode()
                @endif


                $('.go-recharge-btn').click(function () {
                    sendRequest('GET', '{{route("todayDraw", '')}}', {}, function (res) {
                        location.href = '/userCenter?type=uci'
                    })
                })
                $('.go-yjjy-btn').click(function () {
                    sendRequest('GET', '{{route("todayDraw", '')}}', {}, function (res) {
                        location.href = '/userCenter?type=yjjy'
                    })
                })
                $('.go-dh-btn').click(function () {
                    const gid = $(this).attr('data-id')
                    sendRequest('GET', '{{route("todayDraw", '')}}', {}, function (res) {
                        location.href = '/userCenter?type=dh&game_id='+gid
                    })
                })
                $('.yx-btn').click(function () {
                    const cid = $(this).attr('data-ulr')
                   
                    window.open(cid,'_blank')
                })
                
                 $('.yx-ks').click(function () {
                    const sid = $(this).attr('data-ks')
                   
                    window.open(sid,'_blank')
                })
                $('#WeChatLogin').click(function () {
                    openLoginPage()
                })
                $('#outLogin').click(function () {
                    sendRequest('POST', '{{route("login.loginOut", '')}}', {}, function (res) {
                        location.reload()
                    })
                })


                $('.game-tag-btn').click(function () {
                    const id = $(this).attr('data-id')
                    location.href = `/?tag_id=${id}&game_key={{$_GET['game_key']??''}}#game-search`
                })

                $('#search-game').click(function () {
                    const key = $('#game-key').val()
                    location.href = `/?tag_id={{$_GET['tag_id']??''}}&game_key=${key}#game-search`
                })



            })

        </script>

        <style>
            .layui-layer-page, .layui-layer-dialog, .layui-layer-iframe {
                top: 150px !important;
            }
        </style>


        <style>
            .game-money {
                font-size: 30px;
                color: red;
            }
            .game-money span {
                font-size: 26px;
            }

            .game-name {
                font-weight: 900;
                font-size: 20px;
            }
            #qrcode {
                text-align: center;
            }
        </style>

    </body>
    </html>
@endsection
